<?php if ($gtAccount != NULL){ ?>
<!--list only unresolved requests using data received from controller-->
<?php 
    $reqs = array();
    foreach($requests as $request):
        if ($request['Request']['resolved_by'] == "")
        {
            $reqs[] = $request; 
        }
    endforeach;
?>
<!--place details of unresolved requests in table-->
  <table>
        <tr>  
            <th>Request ID </th>
            <th>Employee ID </th>
            <th>Date </th>
            <th>Clock In </th>
            <th>Replaces </th>
            <th>Project ID </th>
            <th>Comment </th>
            <th>Resolved By </th>
            <th>Approve </th>
        </tr>  
            <?php foreach($reqs as $request): ?>
                <tr>  
                   <td><?php echo $request['Request']['request_id']; ?></td>  
                   <td><?php echo $request['Request']['employee_id']; ?></td>  
                   <td><?php echo $request['Request']['date']; ?></td>  
                   <td><?php echo $request['Request']['clock_in']; ?></td>  
                   <td><?php echo $request['Request']['replaces']; ?></td>  
                   <td><?php echo $request['Request']['proj_id']; ?></td>  
                   <td><?php echo $request['Request']['comment']; ?></td>  
                   <td><?php echo $request['Request']['resolved_by']; ?></td>  
                   <td><?php echo $this->Html->link('Deny/Approve',
                        array('controller' => 'Manager',
                        'action' => 'approveRequest',
                        $request['Request']['request_id']
                        )); ?></td>  
                 </tr>  
            <?php endforeach; ?>  
 </table>

<br/>
<br/>
<?php 
        echo $this->Html->link('Return', 
         array('controller' => 'Manager', 'action' => 'index'));?>

<?php } else{ ?>
<h1> Invalid Login </h1>
<?php }?>
